package avicit.bdp.dgs.metadata.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;

import org.apache.commons.lang3.StringUtils;

/**
 * 元数据列明细暂存表
 *
 * @author mayi
 */
@ApiModel(value = "MetadataColumnTmpDTO", description = "bdp_dgs_metadata_column_tmp")
@Table(name = "bdp_dgs_metadata_column_tmp")
public class MetadataColumnTmpDTO extends BaseDTO {
  private static final long serialVersionUID = 1L;

  /** 主键ID */
  @LogField
  @ApiModelProperty(value = "主键")
  @FieldRemark(column = "id", field = "id", name = "主键")
  @Column(name = "id")
  @avicit.platform6.core.annotation.log.Id
  @javax.persistence.Id
  private String id;

  /** 暂存元数据ID */
  @LogField
  @ApiModelProperty(value = "暂存元数据ID", name = "metadataId")
  @FieldRemark(column = "metadata_id", field = "metadataId", name = "暂存元数据ID")
  private String metadataId;

  /** 字段英文名 */
  @LogField
  @ApiModelProperty(value = "字段英文名", name = "name")
  @FieldRemark(column = "name", field = "name", name = "字段英文名")
  private String name;

  /** 字段中文名 */
  @ApiModelProperty(value = "字段中文名", name = "cnName")
  @FieldRemark(column = "cn_name", field = "cnName", name = "字段中文名")
  private String cnName;

  /** 字段备注 */
  @ApiModelProperty(value = "字段备注", name = "remark")
  @FieldRemark(column = "remark", field = "remark", name = "字段备注")
  private String remark;

  /** 字段类型 */
  @ApiModelProperty(value = "字段类型", name = "columnType")
  @FieldRemark(column = "column_type", field = "columnType", name = "字段类型")
  private String columnType;

  /** 字段长度 */
  @ApiModelProperty(value = "字段长度", name = "columnLength")
  @FieldRemark(column = "column_length", field = "columnLength", name = "字段长度")
  private Integer columnLength;

  /** 字段精度 */
  @ApiModelProperty(value = "字段精度", name = "columnPrecision")
  @FieldRemark(column = "column_precision", field = "columnPrecision", name = "字段精度")
  private Integer columnPrecision;

  /** 是否非空 0-否 1-是 */
  @LogField
  @ApiModelProperty(value = "是否非空 0-否 1-是", name = "nullable")
  @FieldRemark(column = "nullable", field = "nullable", name = "是否非空 0-否 1-是")
  private Integer nullable;

  /** 是否主键 0-否 1-是 */
  @LogField
  @ApiModelProperty(value = "是否主键 0-否 1-是", name = "primarykey")
  @FieldRemark(column = "primarykey", field = "primarykey", name = "是否主键")
  @Column(name = "primarykey")
  private Integer primaryKey;

  /** 是否唯一 0-否 1-是 */
  @LogField
  @ApiModelProperty(value = "是否唯一  0-否 1-是", name = "uniquekey")
  @FieldRemark(column = "uniquekey", field = "uniquekey", name = "是否唯一")
  @Column(name = "uniquekey")
  private Integer uniqueKey;

  /** 是否外键 0-否 1-是 */
  @LogField
  @ApiModelProperty(value = "是否外键  0-否 1-是", name = "foreignKey")
  @FieldRemark(column = "foreignKey", field = "foreignKey", name = "是否外键")
  @Column(name = "foreignKey")
  private Integer foreignKey;

  /** 数据标准ID */
  @ApiModelProperty(value = "数据标准ID", name = "standardId")
  @FieldRemark(column = "standard_id", field = "standardId", name = "数据标准ID")
  private String standardId;

  /** 是否可修改 0 否 1是 */
  @ApiModelProperty(value = "是否可修改 0 否 1是", name = "modifyable")
  @FieldRemark(column = "modifyable", field = "modifyable", name = "是否可修改 0 否 1是")
  private Integer modifyable;

  /** 排序 */
  @ApiModelProperty(value = "排序", name = "orderBy")
  @FieldRemark(column = "order_by", field = "orderBy", name = "排序")
  private Integer orderBy;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getMetadataId() {
    return metadataId;
  }

  public void setMetadataId(String metadataId) {
    this.metadataId = metadataId;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getCnName() {
    return cnName;
  }

  public void setCnName(String cnName) {
    this.cnName = cnName;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public String getColumnType() {
    return columnType;
  }

  public void setColumnType(String columnType) {
    this.columnType = columnType;
  }

  public Integer getColumnLength() {
    return columnLength;
  }

  public void setColumnLength(Integer columnLength) {
    this.columnLength = columnLength;
  }

  public Integer getColumnPrecision() {
    return columnPrecision;
  }

  public void setColumnPrecision(Integer columnPrecision) {
    this.columnPrecision = columnPrecision;
  }

  public Integer getNullable() {
    return nullable;
  }

  public void setNullable(Integer nullable) {
    this.nullable = nullable;
  }

  public Integer getPrimaryKey() {
    return primaryKey;
  }

  public void setPrimaryKey(Integer primaryKey) {
    this.primaryKey = primaryKey;
  }

  public Integer getUniqueKey() {
    return uniqueKey;
  }

  public void setUniqueKey(Integer uniqueKey) {
    this.uniqueKey = uniqueKey;
  }

  public Integer getForeignKey() {
    return foreignKey;
  }

  public void setForeignKey(Integer foreignKey) {
    this.foreignKey = foreignKey;
  }

  public String getStandardId() {
    return standardId;
  }

  public void setStandardId(String standardId) {
    this.standardId = standardId;
  }

  public Integer getModifyable() {
    return modifyable;
  }

  public void setModifyable(Integer modifyable) {
    this.modifyable = modifyable;
  }

  public Integer getOrderBy() {
    return orderBy;
  }

  public void setOrderBy(Integer orderBy) {
    this.orderBy = orderBy;
  }

  public String getLogFormName() {
    if (StringUtils.isEmpty(super.logFormName)) {
      return "元数据列明细暂存表";
    } else {
      return super.logFormName;
    }
  }

  public String getLogTitle() {
    if (StringUtils.isEmpty(super.logTitle)) {
      return "元数据列明细暂存表";
    } else {
      return super.logTitle;
    }
  }
}
